package com.suxin.ratelimit.repository;

import com.suxin.ratelimit.Rate;
import com.suxin.ratelimit.properties.RateLimiterProperties;

/**
 * @author Tang
 * @classname RateLimiter
 * @description [ 顶层消费者接口 ]
 * @date 2021/7/15 14:06
 */
@FunctionalInterface
public interface RateLimiter {
    /**
     * 消费者
     * @param policy 限流策略配置
     * @param key 限流类
     * @return
     */
    public Rate consumer(RateLimiterProperties.Policy policy,String key);
}
